$(function() {
	var game_id = $("#gameId").val();
	var server_id = $("#serverId").val();
	
	$(document).on("click", ".link-img", function() {
		var iframe = $(this).siblings('iframe');
		var status = iframe.css("display");
		$(".cz-hide").hide();
		//$(".sideBar-ul iframe").attr("src","");
		iframe.attr("src","");
        iframe.attr("src",iframe.data("src"));
		if(status=="none"){
			iframe.show();
		}else{
			iframe.hide();
		}
		//alert()
		//return false;
		$(".link-img").each(function(){
			$(this).css("background",'url('+$(this).attr("icon")+')');
		});
		$(this).css("background",'url('+$(this).attr("icon_active")+')');
	})
	
	//防止页面不断请求
	$('.shouqi').click(function(){
		$(".sideBar-ul iframe").attr("src","");
	})
	
	$(document).on("click", ".logo", function() {
		window.open("https://www.youzu.com");         
	});
	
	$(".logo").css("cursor","pointer");
});

function game_push_callback(){
    var game_id = $("#gameId").val();
    var data_loc_set = [
        //绑定dom
        ['a']
    ];
    var data_id = {"积分":'point', '充值':'pay', '礼包':'gift', '论坛':'forum', '商城':'shop', '精灵':'genius', '客服':'kf'};

    $(".pstat").each(function (index) {
        // console.log($(this));
        $(this).find(data_loc_set[0][0]).each(function (childindex) {
        	var name = $(this).attr('name');
        	if (typeof data_id[name] == 'undefined') {
                data_id[name] = 'normal';
			}
            $(this).attr('data_loc_id', '001400002');
            $(this).attr('data_id','1_' + data_id[name]);
            $(this).attr('event_type', 'click');
            if (!$(this).attr("custom")) {
                $(this).attr('custom', 'game_id:' + game_id);
            }
        });
    });
}
	
